
#include <stdint.h>

uint16_t convert_fi_code_to_value(uint8_t fi_code)
{	
	static const unsigned int fi_table[] = {372,372,558,744,1116,1488,1860,0,0,512,768,1024,1536,2048,0,0};
	return fi_table[fi_code];	
}

uint8_t convert_di_code_to_value(uint8_t di_code)
{
	static const unsigned int di_table[] = {0,1,2,4,8,16,32,64,12,20,0,0,0,0,0,0};
	return di_table[di_code];
}

uint8_t reverse_byte(uint8_t ch)
{
    uint8_t reverse;

    reverse = (ch >> 4) | (ch << 4);
    reverse = ((reverse & 0x33) << 2) | ((reverse & 0xCC) >> 2);
    reverse = ((reverse & 0x55) << 1) | ((reverse & 0xAA) >> 1);

    return reverse;
}


